import Layout from '../../layout';

const settingRouter = {
  path: '/setting',
  component: Layout,
  redirect: 'noRedirect',
  name: 'setting',
  meta: {
    title: '端口发房',
    icon: 'el-icon-s-management',
  },
  children: [
    {
      path: 'publish',
      component: () => import('@/views/setting/PublishHouseList/PublishHouseList'),
      name: 'PublishHouseList',
      hidden: true,
      meta: { title: '出售发房', noCache: true },
    },
    {
      path: 'rentHouse',
      component: () => import('@/views/house/houseList'),
      name: 'rentHouse',
      meta: { title: '出租发房', noCache: true }
    },
    {
      path: 'log',
      component: () => import('@/views/operation/log'),
      name: 'log',
      meta: { title: '发房日志', noCache: true },
    },
    {
      path: 'sendHouse',
      component: () => import('@/views/operation/sendHouse'),
      name: 'sendHouse',
      props: true,
      hidden: true,
      meta: { title: '发房推送', noCache: true },
    },
  ],
};

export const togglePublishNav = function(isHide = false) {
  settingRouter.children[0].hidden = isHide;
};

export default settingRouter;
